<html>
<head>
<title>VoIP System</title>
</head>
<body>
	<%@ page import="pl.edu.agh.mobicentsVoIP.core.User"%>
	<%@ page import="pl.edu.agh.mobicentsVoIP.core.Call"%>
	<%@ page import="pl.edu.agh.mobicentsVoIP.core.CallStatus"%>
	<%@ page import="pl.edu.agh.mobicentsVoIP.database.HSQLFacade"%>
	<%@ include file="banner.jsp" %>
	<hr />
	<h3>
		Witaj adminie
		<%=request.getRemoteUser()%></h3>
	<hr>

	<h4>Przeprowadzone rozmowy:</h4>

	<%
		HSQLFacade facade = new HSQLFacade();
		for (User user : facade.getAllUsers()) {
			out.println("<h4>Rozmowy uzytkownika "
					+ user.getName()
					+ " </h4><table border=\"1\"><tr><th>Nadawca</th><th>Odbiorca</th><th>Status</th></tr>");
			for (Call c : facade.getAllUserCalls(user)) {
				out.println("<tr><td>" + c.getFrom().getName()
						+ "</td><td>" + c.getTo().getName() + "</td><td>"
						+ c.getStatus().toString() + "</td></tr>");
			}
			out.println("</table>");
		}
	%>
	</table>
	<br>
	<hr>
</body>
</html>